﻿#region << 版 本 注 释 >>

/*----------------------------------------------------------------
* 类 名 称 ：IRes
* 类 描 述 ：
* 作    者 ：henrychang
* 创建时间 ：2019/1/6 18:18:22
*******************************************************************
* Copyright @ henrychang 2019. All rights reserved.
*******************************************************************
//----------------------------------------------------------------*/

#endregion << 版 本 注 释 >>

using System;
using TouchFish.ObjectPool;
using TouchFish.RefCounter;

namespace TouchFish.AssetLoad
{
    public static class ResState
    {
        public const short Waiting = 0;
        public const short Loading = 1;
        public const short Ready = 2;
    }

    public static class ResType
    {
        public const short AssetBundle = 0;
        public const short ABAsset = 1;
        public const short ABScene = 2;
        public const short Internal = 3;
        public const short NetImageRes = 4;
        public const short LocalImageRes = 5;
    }

    public interface IRes : IRefCounter, IPoolType, IEnumeratorTask
    {
        string AssetName { get; }

        string OwnerBundleName { get; }

        short State { get; }

        UnityEngine.Object Asset { get; }

        float Progress { get; }

        void RegisteResListener(Action<bool, IRes> listener);

        void UnRegisteResListener(Action<bool, IRes> listener);

        bool UnloadImage(bool flag);

        bool LoadSync();

        void LoadAsync();

        string[] GetDependResList();

        bool IsDependResLoadFinish();

        bool ReleaseRes();

        void AcceptLoaderStrategySync(IResLoader loader, IResLoaderStrategy strategy);

        void AcceptLoaderStrategyAsync(IResLoader loader, IResLoaderStrategy strategy);
    }
}